LearningSession.Abandon Method

Stops the session by abandoning all activities in the session.

Parent Type: LearningSession

Namespace: Microsoft.LearningComponents

Assembly: Microsoft.LearningComponents.dll

Syntax
C#

public virtual void Abandon ()

Exceptions
Exception type Condition
InvalidOperationException

Thrown if the session is in a state which cannot be abandoned. Use IsAbandonValid to anticipate if this exception will be thrown.

Remarks

This method does not save changes that result from abandoning the session. The application should call CommitChanges after this method and prior to disposing the object to ensure changes are persisted.

PostCondition rules are not run after abandoning the session. Any current value of NavigationRequest.ExitMode of LearningDataModel.NavigationRequest will be ignored.

A session that has been abandoned cannot be resumed at a later time.